#include<stdio.h>
int newN(int N)
{
	int tho = N/1000;
	int hun = N/100-tho*10;
	int ten = N/10-tho*100-hun*10;
	int ge = N-tho*1000-hun*100-ten*10;
	return ((tho+hun+ten+ge)*3+1);
	
}
int main()
{
	int N = 0;
	int chance = 1;
	
	scanf("%d",&N);
	for(int i=0;;i++)
	{  int current = newN(N);
		int next = newN(current);
		printf("%d:%d\n",chance++,current);
		if(current == next)
		{
			printf("%d:%d\n",++chance,current);
			break;
		}
	}
	
	return 0;
}
#include<stdio.h>

int newN(int N) {
	int sum = 0;
	while (N > 0) {
		sum += N % 10;
		N /= 10;
	}
	return sum * 3 + 1;
}

int main()
{
	int initial_N;
	int chance = 1;
	
	scanf("%d", &initial_N);
	
	int current = newN(initial_N);
	printf("%d:%d\n", chance++, current);
	if(current==newN(current))
		goto m;
	while (1)
	{
		int next = newN(current);
		printf("%d:%d\n", chance++, next);
		
		if (current == next)
		{
			break;
		}
		
		current = next;
	}
	m:
	return 0;
}
